package com.ny.zmb.openapi.jh.controller;

import com.ny.zmb.openapi.controller.entity.Result;
import com.ny.zmb.openapi.jh.from.CategoryVo;
import com.ny.zmb.openapi.jh.service.JHCategoryService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("jh/category")
@RestController
@CrossOrigin
public class JHCategortController {

    /**
     * 商品分类
     * @param id
     * @return
     */
    @GetMapping("list")
    public Result list(Integer id){
        List<CategoryVo> category = JHCategoryService.category(id);
        return Result.ok(category);
    }
}
